<%@ page language="java" import = "java.sql.*" contentType="text/html; charset=utf-8"%>
<% request.setCharacterEncoding("utf-8"); %>
<%@ page import="DataBase.DbcpBean" %>
<%@ page import="DataBase.Datasource" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>

<style>
*{ padding:0; margin:0; font-size:12px;}
#bg{background:#000000;opacity: 0.5;-moz-opacity:0.5; filter:alpha(opacity=50); width:100%; height:100%;position:absolute; top:0; left:0}
#info{height:0px; width:0px;top:20%; left:50%;position:absolute; line-height:1.7}
#center{background:#fff;border:1px solid #217AC1; width:400px; height:50px; position:absolute; margin:-50px -150px;}
#center strong{ display:block; padding:2px 5px; background:#EBF4FC; color:#519FEE;}
#center p{padding:10px; text-align:center; color:#1C6FB8;}
</style>

<link href="images/skin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
.STYLE7 {font-size: 12}
-->
</style>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>



<script language="javascript" type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'check_pack.jsp' starting page</title>
	
  </head>
 
<body>
<link href="images/skin.css" rel="stylesheet" type="text/css" />

             
<%
  String strPage;
  int intPageSize; //一页显示的记录数 
  int intRowCount; //记录总数 
  int intPageCount; //总页数 
  int intPage; //待显示页码 
  int i; 
  ResultSet rs = null;
  Datasource ds;
  try{
  DbcpBean dbcp = new DbcpBean();
  Connection conn = dbcp.getConnection();//连接数据库
  Statement stmt = conn.createStatement();
  String sql = "select tb_datasource.*,tb_backup.* from tb_datasource,tb_backup where tb_datasource.ds_ID=tb_backup.ds_ID;";
  rs  = stmt.executeQuery(sql);
  }catch(SQLException e){
  e.printStackTrace();
  }
   //设置一页显示的记录数 
   intPageSize = 11; 
   //取得待显示页码 
   strPage = request.getParameter("page"); 
   if(strPage==null ||strPage=="")
    {//表明在QueryString中没有page这一个参数，此时显示第一页数据 
       intPage = 1; 
    } 
    else
    {//将字符串转换成整型 
       intPage = java.lang.Integer.parseInt(strPage); 
       if(intPage<1) 
          intPage = 1; 
    } 
    //获取记录总数 
    rs.last();//光标在最后一行 
    intRowCount = rs.getRow();//获得当前行号 
    //记算总页数 
    intPageCount = (intRowCount+intPageSize-1) / intPageSize; 
    //调整待显示的页码 
    if(intPage>intPageCount) 
        intPage = intPageCount; 
    %>                                        

<table width="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>
    <td width="17" valign="top" background="Jsp/images/mail_leftbg.gif"><img src="Jsp/images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="Jsp/images/content-bg.gif">
    <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">当前位置：查看备份</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="Jsp/images/mail_rightbg.gif"><img src="Jsp/images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  
  <tr>
  
    <td valign="middle" background="Jsp/images/mail_leftbg.gif">&nbsp;</td>
    
    <td valign="top" bgcolor="#F7F8F9">
     <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100%" height="40">
         <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="935" valign="top" bgcolor="#F7F8F9">
             <table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
              
              <tr>
                <td valign="top">
                  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                  
                  <tr>
                    <td>
                    
					<form name="form1" action="CheckPackServerlet" method="post" >起始日期：<input class="Wdate" type="text" name="SDate" onClick="WdatePicker()"> 
　　					截止日期：<input class="Wdate" type="text" name="EDate" onClick="WdatePicker()">&nbsp;&nbsp;&nbsp; &nbsp;  
					主机名： 
					<label>
					<input name="tf2" type="text" size="10">
					</label>
					<label>
					<input type="submit" name="Submit" value="搜索"  />
					</label>
					</form>
					
					</td>
                  </tr>
                  
         <tr>
                    <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                      <tr>
                        <td class="left_bt2"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#DDDAFE" onMouseOver="changeto()"  onmouseout="changeback()">
                            <tr>
                              <td width="7%" height="26" background="/website/images/a.jpg" class="STYLE1"><div align="center" class="STYLE2 STYLE1">主机名</div></td>
                              <td width="21%" height="26" background="/website/images/a.jpg" class="STYLE1"><div align="center" class="STYLE2 STYLE1">数据源ip地址</div></td>
                              <td width="19%" height="26" background="/website/images/a.jpg" class="STYLE1"><div align="center" class="STYLE2 STYLE1">备份时间</div></td>
                              <td width="40%" height="26" background="/website/images/a.jpg"" class="STYLE1"><div align="center" class="STYLE2">源路径</div></td>
                              <td width="13%" height="26" background="/website/images/a.jpg" class="STYLE1"><div align="center" class="STYLE2">下载</div></td>
                            </tr>
                             <% 
                             if(intPageCount>0)
                             {//将记录指针定位到待显示页的第一条记录上 
                             rs.absolute((intPage-1) * intPageSize + 1); 
                             //显示数据 
                             i = 0; 
                             %>
                           <%                           
                           while(i<intPageSize && !rs.isAfterLast())
                            {
                            %>
                            <tr>            
                            <td height="25" bgcolor="#F8F9FA" class="STYLE2"><div align="center" class="STYLE2 STYLE1"><%=rs.getString(2)%></div></td>
                            <td height="25" bgcolor="#F8F9FA"><div align="center" class="STYLE2 STYLE1"><%=rs.getString(3)%></div></td>
                            <td height="25" bgcolor="#F8F9FA"><div align="center" class="STYLE2 STYLE1"><%=rs.getString(7)%></div></td>
                            <td height="25" bgcolor="#F8F9FA"><div align="center" ><%=rs.getString(8)%></div></td>
                            <td height="25" bgcolor="#F8F9FA"><div align="center">[<a href="Jsp/11.rar">下载</a><span class="STYLE1">]</span></div></td>
	                        </tr>
                            <% 
                            rs.next();
                            i++; 
                             } 
                            %>
                            <%} %>
                 			
                          </table></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="27" align="right">
					<form method="post" action="Jsp/html/user/check_pack.jsp"> 	
   						 第<%=intPage%>页&nbsp; 共<%=intPageCount%>页&nbsp; 
 						<%if(intPage<intPageCount)
						{%>
						<a class=1 href="Jsp/html/user/check_pack.jsp?page=<%=intPage+1%>">下一页 </a>
						<%}%>
						<%if(intPage>1)
						{%>
						<a class=1 href="Jsp/html/user/check_pack.jsp?page=<%=intPage-1%>"> 上一页</a>
						<%}%> 
						&nbsp;转到第：<input type="text" name="page" size="2"> 页 
						<input class=buttonface type=submit value="GO" name="cndok" >
						<input type=hidden name="form" value="jumppage">
					</form>  
                    </td>
                  </tr>
                </table>
               </td>
              </tr>
            </table></td>
            
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td background="Jsp/images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="Jsp/images/mail_leftbg.gif"><img src="Jsp/images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="Jsp/images/buttom_bgs.gif"><img src="Jsp/images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="Jsp/images/mail_rightbg.gif"><img src="Jsp/images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
  
</body>
</html>
<% 
//关闭结果集 
rs.close(); 
%> 
                           
  
                                
                                      







